package com.fjec.market.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fjec.common.view.ServiceProjectVO;
import com.fjec.market.entity.InfoServiceProject;
import com.fjec.market.service.IInfoServiceProjectService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 003.服务项目表（包括礼物） 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-09-18
 */
@RestController
@RequestMapping("/")
public class InfoServiceProjectController {

    @Resource
    private IInfoServiceProjectService service;

    @GetMapping("/serviceproject/getByServType")
    public List<Map<String, Object>> getServiceProjectByServType(int servType) {
        List<Map<String, Object>> serviceProjects = service.listMaps(new QueryWrapper<InfoServiceProject>().eq("ServType", servType));
        return serviceProjects;
    }

    /**
     * 根据礼物Ids获取服务
     *
     * @param giftIds
     * @return
     * @throws Exception
     */
    @GetMapping("/service/project/get/by/ids")
    public Map<String, ServiceProjectVO> getServiceProjectByIds(@RequestParam("giftIds") String giftIds) throws Exception {
        return service.getServiceProjectByIds(giftIds);
    }
}
